import Axios from '../util/axios_base';

import localStorage from '../util/local_storage';

if (localStorage.getLocal('user') && localStorage.getLocal('user').accessToken) {
  const token = `Bearer ${localStorage.getLocal('user').accessToken}`;
  Axios.defaults.headers.common.Authorization = token;
}

export default {
  getArticles() {
    return Axios.get('http://www.laravel.com/api/v1/articles', {});
  },
};
